package com.yt.fras.utils;

import java.util.Random;

/**
 * ClassName:MathRandom
 * Package:com.yt.fras.utils
 * Description:
 *
 * @date:2021/7/18 14:37
 * @author:yt
 */

public class MathRandom {

    public static int mathRandom1(int n) {
        Random rand = new Random();
        int randNumber = rand.nextInt((int) Math.pow(10, n) - (int) Math.pow(10, n - 1) + 1) + (int) Math.pow(10, n - 1);
        return randNumber;
    }

    public static int mathRandom2(int n) {
        Random rand = new Random();
        int randNumber = rand.nextInt((int) Math.pow(10, n));
        return randNumber;
    }
}
